import java.util.Scanner;

import static com.sun.javafx.fxml.expression.Expression.add;

public class Demo8 {

        public static int maxSum(int[] nums) {
            int per = 0;
            int next = 1;
            return Math.max(add(per,nums),add(next,nums));
        }

    private static int add(int index, int[] nums) {
            int count = 0;
        for (int i = index; i < nums.length; i += 2) {
            count += nums[i];
        }
        return count;
    }

    public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            while(true){
                String str = scanner.nextLine();
                String[] strings = str.split(",");
                int[] nums = new int[strings.length];
                for (int i = 0; i < nums.length; i++) {
                    nums[i] = Integer.parseInt(strings[i]);
                }
                System.out.println(maxSum(nums));
            }
        }
    }
